home *** CD-ROM | disk | FTP | other *** search
/ Internet Surfer 2.0 / Internet Surfer 2.0 (Wayzata Technology) (1996).iso / pc / text / mac / faqs.468 < prev    next >
Encoding:
Text File  |  1996-02-12  |  27.7 KB  |  742 lines

  1. Frequently Asked Questions (FAQS);faqs.468
  2.  
  3.  
  4.  
  5. I invented some new "scramble by rotation" puzzles myself. My favourite
  6. creation is the Twisty Torus. It is a torus puzzle with segments (which
  7. slide around 360 degrees) with multiple rings around the circumference.
  8.  
  9. The computer puzzle simulation library I'm forming will be described
  10. in depth in DOTC #4 (The Domain of the Cube Newsletter). So if you
  11. have any interesting computer puzzle programs please email me and
  12. tell me all about them!
  13.  
  14. Also to the people interested in obtaining a subscription to DOTC,
  15. who are outside of Canada (which it seems is just about all of you!)
  16. please don't send U.S. or non-Canadian stamps (yeah, I know I said
  17. Self-Addressed Stamped Envelope before). Instead send me an
  18. international money order in Canadian funds for $6. I'll send you
  19. the first 4 issues (issue #4 is almost finished).
  20.  
  21. Mark Longridge
  22. Address: 259 Thornton Rd N, Oshawa Ontario Canada, L1J 6T2
  23. Email:   mark.longridge@canrem.com
  24.  
  25. One other thing, the six bucks is not for me to make any money. This
  26. is only to cover the cost of producing it and mailing it. I'm
  27. just trying to spread the word about DOTC and to encourage other
  28. mechanical puzzle lovers to share their ideas, books, programs and
  29. puzzles. Most of the programs I've written and/or collected are
  30. shareware for C64, Amiga and IBM. I have source for all my programs
  31. (all in C or Basic) and I am thinking of providing a disk with the
  32. 4th issue of DOTC. If the response is favourable I will continue
  33. to provide disks with DOTC.
  34.  
  35.     -- Mark Longridge <mark.longridge@canrem.com> writes:
  36.  
  37. It may interest people to know that in the latest issue of "Cubism For Fun" %
  38. (# 28 that I just received yesterday) there is an article by Herbert Kociemba
  39. from Darmstadt.  He describes a program that solves the cube.  He states that
  40. until now he has found no configuration that required more than 21 turns to
  41. solve.
  42.  
  43. He gives a 20 move manoeuvre to get at the "all edges flipped/
  44. all corners twisted" position:
  45.     DF^2U'B^2R^2B^2R^2LB'D'FD^2FB^2UF'RLU^2F'
  46. or in Varga's parlance:
  47.     dofitabiribirilobadafodifobitofarolotifa
  48.  
  49. Other things #28 contains are an analysis of Square 1, an article about
  50. triangular tilings by Martin Gardner, and a number of articles about other
  51. puzzles.
  52. --
  53. %  CFF is a newsletter published by the Dutch Cubusts Club NKC.
  54. Secretary:
  55.     Anneke Treep
  56.     Postbus 8295
  57.     6710 AG  Ede
  58.     The Netherlands
  59. Membership fee for 1992 is DFL 20 (about$ 11).
  60. --
  61.     -- dik t. winter <dik@cwi.nl>
  62.  
  63. References:
  64.  
  65. E. C. Turner & K. F. Gold, "Rubik's Groups", American Mathematical Monthly,
  66.    vol. 92 (1985), pp. 617-629.
  67.  
  68. Cubelike Puzzles - What Are They and How Do You Solve Them?
  69. J.A. Eidswick   A.M.M. March, 1986
  70.  
  71. Rubik's Revenge: The Group Theoretical Solution
  72. Mogens Esrom Larsen   A.M.M. June-July, 1985
  73.  
  74. The Group of the Hungarian Magic Cube
  75. Chris Rowley   Proceedings of the First Western Austrialian
  76.         Conference on Algebra, 1982
  77.  
  78. Rubik's Cubic Compendium
  79. Erno Rubik, Tamas Varga, et al
  80. (Ed by David Singmaster)
  81. Oxford University Press, 1987
  82. (Some chapters on mathematics of the cube.)
  83.  
  84. David Singmaster, _Notes on Rubik's `Magic Cube'_
  85.  
  86. "Winning Ways"
  87. by
  88. Berlekamp, Elwyn R.
  89. Conway, John H.
  90. Guy, Richard K.
  91. Volume two, pages 760-768, 808, 809
  92.  
  93. ==> games/rubiks.magic.p <==
  94. How do you solve Rubik's Magic?
  95.  
  96. ==> games/rubiks.magic.s <==
  97. The solution is in a 3x3 grid with a corner missing.
  98.  
  99. +---+---+---+          +---+---+---+---+
  100. | 3 | 5 | 7 |          | 1 | 3 | 5 | 7 |
  101. +---+---+---+          +---+---+---+---+
  102. | 1 | 6 | 8 |          | 2 | 4 | 6 | 8 |
  103. +---+---+---+          +---+---+---+---+
  104. | 2 | 4 |              Original Shape
  105. +---+---+
  106.  
  107. To get the 2x4 "standard" shape into this shape, follow this:
  108. 1.  Lie it flat in front of you (4 going across).
  109. 2.  Flip the pair (1,2) up and over on top of (3,4).
  110. 3.  Flip the ONE square (2) up and over (1).
  111. [Note:  if step 3 won't go, start over, but flip the entire original shape
  112.         over (exposing the back).]
  113. 4.  Flip the pair (2,4) up and over on top of (5,6).
  114. 5.  Flip the pair (1,2) up and toward you on top of (blank,4).
  115. 6.  Flip the ONE square (2) up and left on top of (1).
  116. 7.  Flip the pair (2,4) up and toward you.
  117.  
  118. Your puzzle won't be completely solved, but this is how to get the shape.
  119. Notice that 3,5,6,7,8 don't move.
  120.  
  121. ==> games/scrabble.p <==
  122. What are some exceptional scrabble games?
  123.  
  124. ==> games/scrabble.s <==
  125. The shortest scrabble game:
  126.  
  127. The Scrabble Players News, Vol. XI No. 49, June 1983, contributed by
  128. Kyle Corbin of Raleigh, NC:
  129.  
  130.          [J]
  131.         J U S
  132.           S O X
  133.            [X]U
  134.  
  135. which can be done in 4 moves, JUS, SOX, [J]US, and [X]U.
  136.  
  137. In SPN Vol. XI, No. 52, December 1983, Alan Frank presented what
  138. he claimed is the shortest game where no blanks are used, also
  139. four moves:
  140.  
  141.                   C
  142.                  WUD
  143.                 CUKES
  144.              DEY
  145.               S
  146.  
  147. This was followed in SPN, Vol. XII No. 54, April 1984, by Terry Davis
  148. of Glasgow, KY:
  149.  
  150.               V
  151.                 V O[X]
  152.              [X]U,
  153.  
  154. which is three moves.  He noted that the use of two blanks prevents
  155. such plays as VOLVOX.  Unfortunately, it doesn't prevent SONOVOX.
  156.  
  157. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  158. Record for the highest scrabble score in a single turn (in a legal position):
  159.  
  160. According to the Scrabble Players Newspaper (since renamed to
  161. Scrabble Players News) issue 44, p13, the highest score for one
  162. turn yet discovered, using the Official Scrabble Players
  163. Dictionary, 1st ed. (the 2nd edition is now in use in club and
  164. tournament play) and the Websters 9th New Collegiate Dictionary,
  165. was the following:
  166.  
  167. d i s e q u i l i b r a t e D
  168. . . . . . . . e . . . . . . e
  169. . . . . . . . e . . . . . o m
  170. r a d i o a u t o g r a p(h)Y
  171. . . . . . . . . . . . w a s T
  172. . . . . . . . . . . b e . . h
  173. . . . . . . . . . . a . . g o
  174. . . . c o n j u n c t i v a L
  175. . . . . . . . . . . . . . n o
  176. . . . . . . . f i n i k i n G
  177. . . . . . . . a . . . (l) e i
  178. . . . . . . . d . s p e l t Z
  179. . . . . . . w e . . . . . . e
  180. . . . . . . r . . . . . . o r
  181. m e t h o x y f l u r a n e S
  182.  
  183. for 1682 points.
  184.  
  185.  
  186. According to the May 1986 issue of GAMES, the highest known score achievable
  187. in one turn is 1,962 points.  The word is BENZOXYCAMPHORS formed across the
  188. three triple-word scores on the bottom of the board.  Apparently it was
  189. discovered by Darryl Francis, Ron Jerome, and Jeff Grant.
  190.  
  191. As for other Scrabble trivia, the highest-scoring first move based on the
  192. Official Scrabble Players Dictionary is 120 points, with the words JUKEBOX,
  193. QUIZZED, SQUEEZE, or ZYMURGY.  If Funk & Wagnall's New Standard Dictionary
  194. is used then ZYXOMMA, worth 130 points, can be formed.
  195.  
  196. The highest-scoring game, based on Webster's Second and Third and on the
  197. Oxford English Dictionary, was devised by Ron Jerome and Ralph Beaman and
  198. totalled 4,142 points for the two players.  The highest-scoring words in
  199. the game were BENZOXYCAMPHORS, VELVETEEN, and JACKPUDDINGHOOD.
  200.  
  201. The following example of a SCRABBLE game produced a score of 2448 for one
  202. player and 1175 for the final word.  It is taken from _Beyond Language_ (1967)
  203. by Dmitri Borgman (pp. 217-218).  He credits this solution to Mrs. Josefa H.
  204. Byrne of San Francisco and implies that all words can be found in _Webster's
  205. Second Edition_.  The two large words (multiplied by 27 as they span 3 triple
  206. word scores) are ZOOPSYCHOLOGIST (a psychologist who treats animals rather
  207. than humans) and PREJUDICATENESS (the condition or state of being decided
  208. beforehand).  The asterisks (*) represent the blank tiles. (Please excuse
  209. any typo's).
  210.  
  211.            Board                        Player1                 Player2
  212.  
  213. Z O O P S Y C H O L O G I S T    ABILITY             76   ERI, YE     9
  214. O N         H A   U     R O W    MAN, MI             10   EN          2
  215. *         R I B   R O V E   I    FEN, FUN            14   MANIA       7
  216. L           T I K E         G    TABU                12   RIB         6
  217. O             L                  NEXT                11   AM          4
  218. G             I                  AX                   9   END         6
  219. I             T                  IT, TIKE            10   LURE        6
  220. *             Y E                LEND, LOGIC*AL      79   OO*LOGICAL  8
  221. A               R                FUND, JUD           27   ATE, MA     7
  222. L E N D       M I                ROVE                14   LO          2
  223.     E         A             Q    DARE, DE            13   ES, ES, RE  6
  224. W A X     F E N             U    RE, ROW             14   IRE, IS, SO 7
  225. E   T A B U   I             A    DARED, QUAD         22   ON          4
  226. E         N   A M   D A R E D    WAX, WEE            27   WIG         9
  227. P R E J U D I C A T E N E S S    CHIT, HA            14   ON          2
  228.                                  PREJUDICATENESS,
  229.                                    AN, MANIAC,
  230.                                    QUADS, WEEP      911   OOP         8
  231.                                  ZOOPSYCHOLOGIST,
  232.                                    HABILITY, TWIG,
  233.                                    ZOOLOGICAL      1175
  234.                                  --------------------------------------
  235.                                  Total:            2438              93
  236.  
  237.                                  F, N, V, T in
  238.                                  loser's hand:      +10             -10
  239.                                  --------------------------------------
  240.                                  Final Score:      2448              83
  241.  
  242.  
  243. ---------------------------------------------------------------------------
  244. It is possible to form the following 14 7-letter OSPD words from the tiles:
  245. HUMANLY
  246. FATUOUS
  247. AMAZING
  248. EERIEST
  249. ROOFING
  250. TOILERS
  251. QUIXOTE
  252. JEWELRY
  253. CAPABLE
  254. PREVIEW
  255. BIDDERS
  256. HACKING
  257. OVATION
  258. DONATED
  259.  
  260. ==> games/square-1.p <==
  261. Does anyone have any hints on how to solve the Square-1 puzzle?
  262.  
  263. Xref: bloom-picayune.mit.edu rec.puzzles:18145 news.answers:3076
  264. Newsgroups: rec.puzzles,news.answers
  265. Path: bloom-picayune.mit.edu!enterpoop.mit.edu!snorkelwacker.mit.edu!usc!wupost!spool.mu.edu!uunet!questrel!chris
  266. From: uunet!questrel!chris (Chris Cole)
  267. Subject: rec.puzzles FAQ, part 10 of 15
  268. Message-ID: <puzzles-faq-10_717034101@questrel.com>
  269. Followup-To: rec.puzzles
  270. Summary: This posting contains a list of
  271.      Frequently Asked Questions (and their answers).
  272.      It should be read by anyone who wishes to
  273.      post to the rec.puzzles newsgroup.
  274. Sender: chris@questrel.com (Chris Cole)
  275. Reply-To: uunet!questrel!faql-comment
  276. Organization: Questrel, Inc.
  277. References: <puzzles-faq-1_717034101@questrel.com>
  278. Date: Mon, 21 Sep 1992 00:09:31 GMT
  279. Approved: news-answers-request@MIT.Edu
  280. Expires: Sat, 3 Apr 1993 00:08:21 GMT
  281. Lines: 1487
  282.  
  283. Archive-name: puzzles-faq/part10
  284. Last-modified: 1992/09/20
  285. Version: 3
  286.  
  287. ==> games/square-1.s <==
  288.                 SHAPES
  289.  
  290. 1. There are 29 different shapes for a side, counting reflections:
  291.     1 with 6 corners, 0 edges
  292.     3 with 5 corners, 2 edges
  293.    10 with 4 corners, 4 edges
  294.    10 with 3 corners, 6 edges
  295.     5 with 2 corners, 8 edges
  296.  
  297. 2. Naturally, a surplus of corners on one side must be compensated
  298.    by a deficit of corners on the other side.  Thus there are 1*5 +
  299.    3*10 + C(10,2) = 5 + 30 + 55 = 90 distinct combinations of shapes,
  300.    not counting the middle layer.
  301.  
  302. 3. You can reach two squares from any other shape in at most 7 transforms,
  303.    where a transform consists of (1) optionally twisting the top, (2)
  304.    optionally twisting the bottom, and (3) flipping.
  305.  
  306. 4. Each transform toggles the middle layer between Square and Kite,
  307.    so you may need 8 transforms to reach a perfect cube.
  308.  
  309. 5. The shapes with 4 corners and 4 edges on each side fall into four
  310.    mutually separated classes.  Side shapes can be assigned values:
  311.    0: Square, Mushroom, and Shield; 1: Left Fist and Left Paw; 2:
  312.    Scallop, Kite, and Barrel; 3. Right Fist and Right Paw.  The top
  313.    and bottom's sum or difference, depending on how you look at them,
  314.    is a constant.  Notice that the side shapes with bilateral symmetry
  315.    are those with even values.
  316.  
  317. 6. To change this constant, and in particular to make it zero, you must
  318.    attain a position that does not have 4 corners and 4 edges on each
  319.    side.  Almost any such position will do, but returning to 4 corners
  320.    and 4 edges with the right constant is left to your ingenuity.
  321.  
  322. 7. If the top and bottom are Squares but the middle is a Kite, just flip
  323.    with the top and bottom 30deg out of phase and you will get a cube.
  324.  
  325.                 COLORS
  326.  
  327. 1. I do not know the most efficient way to restore the colors.  What
  328.    follows is my own suboptimal method.  All flips keep the yellow
  329.    stripe steady and flip the blue stripe.
  330.  
  331. 2. You can permute the corners without changing the edges, so first
  332.    get the edges right, then the corners.
  333.  
  334. 3. This transformation sends the right top edge to the bottom
  335.    and the left bottom edge to the top, leaving the other edges
  336.    on the same side as they started:  Twist top 30deg cl, flip,
  337.    twist top 30deg ccl, twist bottom 150deg cl, flip, twist bottom
  338.    30deg cl, twist top 120deg cl, flip, twist top 30deg ccl, twist
  339.    bottom 150deg cl, flip, twist bottom 30deg cl.  Cl and ccl are
  340.    defined looking directly at the face.  With this transformation
  341.    you can eventually get all the white edges on top.
  342.  
  343. 4. Check the parity of the edge sequence on each side.  If either is
  344.    wrong, you need to fix it.  Sorry -- I don't know how!  (See any
  345.    standard reference on combinatorics for an explanation of parity.)
  346.  
  347. 5. The following transformation cyclically permutes ccl all the top edges
  348.    but the right one and cl all the bottom edges but the left one.  Apply
  349.    the transformation in 3., and turn the whole cube 180deg.  Repeat.
  350.    This is a useful transformation, though not a cure-all.
  351.  
  352. 6. Varying the transformation in 3. with other twists will produce other
  353.    results.
  354.  
  355. 7. The following transformation changes a cube into a Comet and Star:
  356.    Flip to get Kite and Kite.  Twist top and bottom cl 90deg and flip to get
  357.    Barrel and Barrel.  Twist top cl 30 and bottom cl 60 and flip to get
  358.    Scallop and Scallop.  Twist top cl 60 and bottom cl 120 and flip to
  359.    get Comet and Star.  The virtue of the Star is that it contains only
  360.    corners, so that you can permute the corners without altering the edges.
  361.  
  362. 8. To reach a Lemon and Star instead, replace the final bottom cl 120 with
  363.    a bottom cl 60.  In both these transformation the Star is on the bottom.
  364.  
  365. 9. The following transformation cyclically permutes all but the bottom
  366.    left rear.  It sends the top left front to the bottom, and the bottom
  367.    left front to the top.  Go to Comet and Star.  Twist star cl 60.
  368.    Go to Lemon and Star -- you need not return all the way to the cube, but
  369.    do it if you're unsure of yourself by following 7 backwards.  Twist star
  370.    cl 60.  Return to cube by following 8 backwards.  With this transformation
  371.    you should be able to get all the white corners on top.
  372.  
  373. 10. Check the parity of the corner sequences on both sides.  If the bottom
  374.    parity is wrong, here's how to fix it:  Go to Lemon and Star.  The
  375.    colors on the Star will run WWGWWG.  Twist it 180 and return to cube.
  376.  
  377. 11. If the top parity is wrong, do the same thing, except that when you
  378.    go from Scallop and Scallop to Lemon and Star, twist the top and bottom
  379.    ccl instead of cl.  The colors on the Star should now run GGWGGW.
  380.  
  381. 12. Once the parity is right on both sides, the basic method is to
  382.    go to Comet and Star, twist the star 120 cl (it will be WGWGWG),
  383.    return to cube, twist one or both sides, go to Comet and Star,
  384.    undo the star twist, return to cube, undo the side twists.
  385.    With no side twists, this does nothing.  If you twist the top,
  386.    you will permute the top corners.  If you twist the bottom,
  387.    you will permute the bottom corners.  Eventually you will get
  388.    both the top and the bottom right.  Don't forget to undo the
  389.    side twists -- you need to have the edges in the right places.
  390.  
  391. Happy twisting....
  392. --
  393. Col. G. L. Sicherman
  394. gls@windmill.att.COM
  395.  
  396. ==> games/think.and.jump.p <==
  397. THINK & JUMP:  FIRST THINK, THEN JUMP UNTIL YOU
  398.                ARE LEFT WITH ONE PEG!                      O - O   O - O
  399.                                                           / \ / \ / \ / \
  400.                                                          O---O---O---O---O
  401. BOARD DESCRIPTION:  To the right is a model of            \ / \ / \ / \ /
  402.                     the Think & Jump board.  The       O---O---O---O---O---O
  403.                     O's represent holes which         / \ / \ / \ / \ / \ / \
  404.                     contain pegs.                    O---O---O---O---O---O---O
  405.                                                       \ / \ / \ / \ / \ / \ /
  406.                                                        O---O---O---O---O---O
  407. DIRECTIONS:  To play this brain teaser, you begin         / \ / \ / \ / \
  408.              by removing the center peg.  Then,          O---O---O---O---O
  409.              moving any direction in the grid,            \ / \ / \ / \  /
  410.              jump over one peg at a time,                  O - O   O - O
  411.              removing the jumped peg - until only
  412.              one peg is left.  It's harder then it looks.
  413.          But it's more fun than you can imagine.
  414.  
  415. SKILL CHART:
  416.  
  417.     10 pegs left - getting better
  418.      5 pegs left - true talent
  419.      1 peg  left - you're a genius
  420.  
  421. Manufactured by Pressman Toy Corporation, NY, NY.
  422.  
  423. ==> games/think.and.jump.s <==
  424. Three-color the board in the obvious way.  The initial configuration has 12
  425. of each color, and each jump changes the parity of all three colors.  Thus,
  426. it is impossible to achieve any position where the colors do not have the
  427. same parity; in particular, (1,0,0).
  428.  
  429. If you remove the requirement that the initially-empty cell must be at the
  430. center, the game becomes solvable.  The demonstration is left as an exercise.
  431.  
  432. Karl Heuer   rutgers!harvard!ima!haddock!karl   karl@haddock.ima.isc.com
  433.  
  434.  
  435.  
  436.  
  437. Here is one way of reducing Think & Jump to two pegs.
  438.  
  439.  
  440. Long simplifies Balsley's scintillating snowflake solution:
  441.  
  442. 1  U-S           A - B   C - D
  443. 2  H-U          / \ / \ / \ / \
  444. 3  V-T         E---F---G---H---I
  445. 4  S-H          \ / \ / \ / \ /
  446. 5  D-M       J---K---L---M---N---O
  447. 6  F-S      / \ / \ / \ / \ / \ / \
  448. 7  Q-F     P---Q---R---S---T---U---V
  449. 8  A-L      \ / \ / \ / \ / \ / \ /
  450. 9  S-Q       W---X---Y---Z---a---b
  451. 10 P-R          / \ / \ / \ / \
  452. 11 Z-N         c---d---e---f---g
  453. 12 Y-K          \ / \ / \ / \ /
  454. 13 h-Y           h - i   j - k
  455. 14 k-Z
  456.  
  457. The board should now be in the snowflake pattern, i.e. look like
  458.  
  459.          o - *   * - o
  460.         / \ / \ / \ / \
  461.        *---o---*---o---*
  462.         \ / \ / \ / \ /
  463.      *---*---*---*---*---*
  464.     / \ / \ / \ / \ / \ / \
  465.    o---o---o---o---o---o---o
  466.     \ / \ / \ / \ / \ / \ /
  467.      *---*---*---*---*---*
  468.         / \ / \ / \ / \
  469.        *---o---*---o---*
  470.         \ / \ / \ / \ /
  471.          o - *   * - o
  472.  
  473. where o is empty and * is a peg.  The top and bottom can now be reduced
  474. to single pegs individually.  For example, we could continue
  475.  
  476. 15 g-T
  477. 16 Y-a
  478. 17 i-Z
  479. 18 T-e
  480. 19 j-Y
  481. 20 b-Z
  482. 21 c-R
  483. 22 Z-X
  484. 23 W-Y
  485. 24 R-e
  486.  
  487. which finishes the bottom.  The top can be done in a similar manner.
  488. --
  489. Chris Long
  490.  
  491. ==> games/tictactoe.p <==
  492. In random tic-tac-toe, what is the probability that the first mover wins?
  493.  
  494. ==> games/tictactoe.s <==
  495. Count cases.
  496.  
  497. First assume that the game goes on even after a win.  (Later figure
  498. out who won if each player gets a row of three.)  Then there are
  499. 9!/5!4! possible final boards, of which
  500.  
  501.     8*6!/2!4! - 2*6*4!/0!4! - 3*3*4!/0!4! - 1 = 98
  502.  
  503. have a row of three Xs.  The first term is 8 rows times (6 choose 2)
  504. ways to put down the remaining 2 Xs.  The second term is the number
  505. of ways X can have a diagonal row plus a horizontal or vertical row.
  506. The third term is the number of ways X can have a vertical and a
  507. horizontal row, and the 4th term is the number of ways X can have two
  508. diagonal rows.  All the two-row configurations must be subtracted to
  509. avoid double-counting.
  510.  
  511. There are 8*6!/1!5! = 48 ways O can get a row.  There is no double-
  512. counting problem since only 4 Os are on the final board.
  513.  
  514. There are 6*2*3!/2!1! = 36 ways that both players can have a
  515. row.  (6 possible rows for X, each leaving 2 possible rows for O
  516. and (3 choose 2) ways to arrange the remaining row.)  These
  517. cases need further consideration.
  518.  
  519. There are 98 - 36 = 62 ways X can have a row but not O.
  520.  
  521. There are 48 - 36 = 12 ways O can have a row but not X.
  522.  
  523. There are 126 - 36 - 62 - 12 = 16 ways the game can be a tie.
  524.  
  525. Now consider the 36 configurations in which each player has a row.
  526. Each such can be achieved in 5!4! = 2880 orders.  There are 3*4!4!
  527. = 1728 ways that X's last move completes his row.  In these cases O
  528. wins.  There are 2*3*3!3! = 216 ways that Xs fourth move completes
  529. his row and Os row is already done in three moves.  In these cases O
  530. also wins.  Altogether, O wins 1728 + 216 = 1944 out of 2880 times
  531. in each of these 36 configurations.  X wins the other 936 out of
  532. 2880.
  533.  
  534. Altogether, the probability of X winning is ( 62 + 36*(936/2880) ) / 126.
  535.  
  536. win:   737 / 1260  ( 0.5849206... )
  537. lose:  121 / 420   ( 0.2880952... )
  538. draw:  8 / 63      ( 0.1269841... )
  539.  
  540. 1000000 games:  won 584865, lost 288240, tied 126895
  541.  
  542. Instead, how about just methodically having the program play every
  543. possible game, tallying up who wins?
  544.  
  545. Wonderful idea, especially since there are only 9! ~ 1/3 million
  546. possible games.  Of course some are identical because they end in
  547. fewer than 8 moves.  It is clear that these should be counted
  548. multiple times since they are more probable than games that go
  549. longer.
  550.  
  551. The result:
  552. 362880 games:  won 212256, lost 104544, tied 46080
  553.  
  554. #include <stdio.h>
  555.  
  556. int    board[9];
  557. int    N, move, won, lost, tied;
  558.  
  559. int    perm[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 };
  560.  
  561. int    rows[8][3] = {
  562.   { 0, 1, 2 }, { 3, 4, 5 }, { 6, 7, 8 }, { 0, 3, 6 },
  563.   { 1, 4, 7 }, { 2, 5, 8 }, { 0, 4, 8 }, { 2, 4, 6 }
  564. };
  565.  
  566.  
  567. main()
  568. {
  569.   do {
  570.     bzero((char *)board, sizeof board);
  571.     for ( move=0; move<9; move++ ) {
  572.       board[perm[move]] = (move&1) ? 4 : 1;
  573.       if ( move >= 4 && over() )
  574.     break;
  575.     }
  576.     if ( move == 9 )
  577.       tied++;
  578. #ifdef DEBUG
  579.     printf("%1d%1d%1d\n%1d%1d%1d  w %d, l %d, t %d\n%1d%1d%1d\n\n",
  580.        board[0], board[1], board[2],
  581.        board[3], board[4], board[5], won, lost, tied,
  582.        board[6], board[7], board[8]);
  583. #endif
  584.     N++;
  585.   } while ( nextperm(perm, 9) );
  586.  
  587.   printf("%d games:  won %d, lost %d, tied %d\n", N, won, lost, tied);
  588.   exit(0);
  589. }
  590.  
  591. int    s;
  592. int    *row;
  593.  
  594. over()
  595. {
  596.   for ( row=rows[0]; row<rows[8]; row+=3 ) {
  597.     s = board[row[0]] + board[row[1]] + board[row[2]];
  598.     if ( s == 3 )
  599.       return ++won;
  600.     if ( s == 12 )
  601.       return ++lost;
  602.   }
  603.   return 0;
  604. }
  605.  
  606. nextperm(c, n)
  607. int    c[], n;
  608. {
  609.   int    i = n-2, j=n-1, t;
  610.  
  611.   while ( i >= 0 && c[i] >= c[i+1] )
  612.     i--;
  613.   if ( i < 0 )
  614.     return 0;
  615.   while ( c[j] <= c[i] )
  616.     j--;
  617.   t = c[i];  c[i] = c[j];  c[j] = t;
  618.   i++;  j = n-1;
  619.   while ( i < j ) {
  620.     t = c[i];  c[i] = c[j];  c[j] = t;
  621.     i++;  j--;
  622.   }
  623.   return 1;
  624. }
  625.  
  626.  
  627.  
  628. ==> geometry/K3,3.p <==
  629. Can three houses be connected to three utilities without the pipes crossing?
  630.  
  631.             _______          _______          _______
  632.             | oil |          |water|          | gas |
  633.             |_____|          |_____|          |_____|
  634.  
  635.  
  636.             _______          _______          _______
  637.             |HOUSE|          |HOUSE|          |HOUSE|
  638.             | one |          | two |          |three|
  639.  
  640. ==> geometry/K3,3.s <==
  641. The problem you describe is to draw a bipartite graph of 3 nodes connected
  642. in all ways to 3 nodes, all embedded in the plane.  The graph is called K3,3.
  643. A famous theorem of Kuratowsky says that all graphs can be embedded
  644. in the plane, EXCEPT those containing K3,3 or K5 (the complete graph
  645. on 5 vertices, i.e., the graph with 5 nodes and 10 edges) as a
  646. subgraph.  So your problem is a minimal example of a graph that
  647. cannot be embedded in the plane.
  648.  
  649. The proofs that K5 and K3,3 are non-planar are really quite easy, and only
  650. depend on Euler's Theorem that F-E+V=2 for a planar graph.
  651. For K3,3 V is 6 and E is 9, so F would have to be 5. But each face has at
  652. least 4 edges, so E >= (F*4)/2 = 10, contradiction.
  653. For K5 V is 5 and E is 10, so F = 7. In this case each face has at least 3
  654. edges, so E >= (F*3)/2 = 10.5, contradiction.
  655.  
  656. The difficult part of Kuratowsky is the proof in the other direction!
  657.  
  658. A quick, informal proof by contradiction without assuming Euler's Theorem:
  659. Using a map in which the houses are 1, 2, and 3 and the utilities are
  660. A, B, and C, there must be continuous lines that connect the buildings and
  661. divide the area into three sections bounded by the loops A-1-B-2-A,
  662. A-1-B-3-A, and A-2-B-3-A.  (One of the areas is the infinite plane *around*
  663. whichever loop is the outer edge of the network.)  C must be in one of these
  664. three areas; whichever area it is in, either 1, or 2, or 3, is *not* part of
  665. the loop that rings its area and hence is inaccessible to C.
  666.  
  667. The usual quibble is to solve the puzzle by running one of the pipes
  668. underneath one of houses on its way to another house; the puzzle's
  669. instructions forbid crossing other *pipes*, but not crossing other *houses*.
  670.  
  671. ==> geometry/bear.p <==
  672. If a hunter goes out his front door, goes 50 miles south, then goes 50
  673. miles west, shoots a bear, goes 50 miles north and ends up in front of
  674. his house.  What color was the bear?
  675.  
  676. ==> geometry/bear.s <==
  677. The hunter's door is in one of two locations.  One is a foot or so from the
  678. North Pole, facing north, such that his position in front of the door is
  679. precisely upon the North Pole.  Since that's a ridiculous place to build a
  680. house and since bears do not roam within fifty miles of the pole, the bear
  681. is either imaginary or imported, and there is no telling what color it is.
  682.  
  683. There is another place (actually a whole set) on earth from which one can go
  684. fifty miles south, fifty miles west, and fifty miles north and end up where
  685. one started.  Consider the parallel of latitude close enough to the South
  686. Pole that the circumference of the earth at that latitude is 50/n miles,
  687. for some integer n.
  688.  
  689. Take any point on that parallel of latitude and pick the point fifty miles
  690. north of it.  Situate the hunter's front porch there.  The hunter goes fifty
  691. miles south from his porch and is at a point we'll call A.  He travels fifty
  692. miles west, going n times around the earth, and is at A again, where he shoots
  693. the bear.  Fifty miles north from A he is back home.  Since bears are not
  694. indigenous to the Antarctic, again the bear is either imaginary or imported
  695. and there is no telling what color it might be.
  696.  
  697. ==> geometry/bisector.p <==
  698. If two angle bisectors of a triangle are equal, then the triangle is
  699. isosceles (more specifically, the sides opposite to the two angles
  700. being bisected are equal).
  701.  
  702. ==> geometry/bisector.s <==
  703. The following proof is probably from Altshiller-Court's College
  704. Geometry, since that's where I first saw the problem.
  705.  
  706. Let the triangle be ABC, with angle bisectors BE and CD.
  707. Let F be such that BEFD is a parallelagram.
  708. Let x  = measure of angle CBE = angle DBE,
  709.     y  = measure of angle BCD = angle DCE,
  710.     x' = measure of angle EFC,
  711.     y' = measure of angle ECF.
  712. (You will probably want to draw a picture.)
  713.  
  714. Suppose x > y.  Consider the triangles EBC and DCB.  Since BC = BC and
  715. BE = CD, we must have CE > BD.  Now, since BD = EF, we have that CE >
  716. EF, so that x' > y'.  Thus x+x' > y+y'.  But, triangle FDC is
  717. isosceles, since DF = BE = DC, so x+x' = y+y', a contradiction.
  718. Similarly, we cannot have x < y.  Therefore the base angles of ABC are
  719. equal, making ABC an isosceles triangle. QED
  720.  
  721.  
  722.  
  723.  
  724. ==> geometry/calendar.p <==
  725. Build a calendar from two sets of cubes.  On the first set,
  726. spell the months with a letter on each face of three cubes.
  727. Use lowercase three-letter abbreviations for the names of all
  728. twelve months (e.g., "jan", "feb", "mar").  On the second set,
  729. number the days with a digit on each face of two cubes (e.g.,
  730. "01", "02", etc.).
  731.  
  732. ==> geometry/calendar.s <==
  733.     First note that there are *nineteen* different letters in the
  734. month abbreviations (abcdef gjlmno prstuv y) so to get them all on the
  735. eighteen faces of 3 cubes, you know right away you're going to have to
  736. resort to trickery.
  737.  
  738.     So I wrote them all down and looked at which ones could be
  739. reversed to make another letter in the set.  The only pair that jumped
  740. out at me was the d/p pair.  Now I knew that it was at least feasible,
  741. as long as it wasn't necessary to duplicate any letters.
  742.